import service from '@/utils/request';
// 增加供应商
export function AddSupplier(data) {
  return service.request({
    method: 'post',
    url: '/supplier/add.do',
    data
  })
}
// 获取供应商
export function GetSuppierPage(data) {
  return service.request({
    method: 'post',
    url: '/supplier/findAllSupplier.do',
    data
  })
}
// 获取供应商
export function GetSuppier() {
  return service.request({
    method: 'get',
    url: '/supplier/findSupplier.do',
  })
}
// 修改供应商
export function UpdateSupplier(data) {
  return service.request({
    method: 'post',
    url: '/supplier/update.do',
    data
  })
}
// 搜索供应商
export function SearchSupplier(data) {
  return service.request({
    method: 'post',
    url: '/supplier/searchSupplier.do',
    data
  })
}
// 删除供应商
export function DelSupplier(data) {
  return service.request({
    method: 'get',
    url: '/supplier/delete.do?supplierId='+data,
  })
}

// 获取装备分类
export function GetAllProdCate() {
  return service.request({
    method: 'get',
    url: '/prodcategory/selectTwo.do',
  })
}
// 获取二级装备分类
export function GetAllTwoCate() {
  return service.request({
    method: 'get',
    url: '/categoryTwoController/selectCategorytwoAll',
  })
}
// 获取二级装备分类通过一级分类Id
export function GetTwoCateById(data) {
  return service.request({
    method: 'get',
    url: '/categoryTwoController/selectCategorytwo?categoryId='+data.categoryId,
  })
}
// 根据二级分类获取装备信息
export function GetProdsByCate(data) {
  return service.request({
    method: 'get',
    url: '/categoryTwoController/selectProd.do?categoryTwoId='+data,
  })
} 
// 根据二级分类和装备名称搜索装备信息
export function SearchProdsByCate(data) {
  return service.request({
    method: 'get',
    url: '/prodcategory/selectCategoty?categoryTwoId='+data.categoryTwoId+'&prodName='+data.prodName,
  })
} 
// 根据一级分类和二级名称搜索
export function SearchTwoCate(data) {
  return service.request({
    method: 'get',
    url: '/categoryTwoController/selectCategorytwo?categoryId='+data.categoryId+'&categoryTwoName='+data.categoryTwoName,
  })
} 
// 增加装备二级分类
export function AddProdTwoCate(data) {
  return service.request({
    method: 'post',
    url: '/categoryTwoController/add.do',
    data
  })
}
// 删除装备二级分类
export function DelProdTwoCate(data) {
  return service.request({
    method: 'get',
    url: '/categoryTwoController/delete.do?categoryTwoId='+data,
  })
}
// 修改装备分类
export function EditProdTwoCate(data) {
  return service.request({
    method: 'post',
    url: '/categoryTwoController/update.do',
    data
  })
}

// 增加装备分类
export function AddProdCate(data) {
  return service.request({
    method: 'post',
    url: '/prodcategory/add.do',
    data
  })
}
// 删除装备分类
export function DelProdCate(data) {
  return service.request({
    method: 'get',
    url: '/prodcategory/delete.do?categoryId='+data,
  })
}
// 获取装备分类
export function GetProdCate() {
  return service.request({
    method: 'get',
    url: '/prodcategory/select.do',
  })
}
// 修改装备分类
export function EditProdCate(data) {
  return service.request({
    method: 'post',
    url: '/prodcategory/update.do',
    data
  })
}
// 搜索装备分类
export function SearchProdCate(data) {
  return service.request({
    method: 'get',
    url: '/prodcategory/selectByName?categoryName='+data.categoryName+'&categoryNumber='+data.categoryNumber,
  })
}


// 增加装备信息
export function AddProduct(data) {
  return service.request({
    method: 'post',
    url: '/prod/add.do',
    data
  })
}
// 删除装备信息
export function DelProduct(data) {
  return service.request({
    method: 'get',
    url: '/prod/delete.do?prodId='+data,
  })
}
// 获取全部装备信息
export function GetProduct() {
  return service.request({
    method: 'get',
    url: '/prod/select.do',
  })
}
// 获取装备信息分页
export function GetProductPage(data) {
  return service.request({
    method: 'post',
    url: '/prod/findAllProd',
    data
  })
}
// 修改装备信息
export function EditProduct(data) {
  return service.request({
    method: 'post',
    url: '/prod/update.do',
    data
  })
}
// 更据分类查找装备信息
export function SelectByProdCate(data) {
  return service.request({
    method: 'get',
    url: '/prod/selectByCategory.do?categoryId='+data,
  })
}
// 更据名称和编号查找装备信息
export function SelectByProdInfo(data) {
  return service.request({
    method: 'post',
    url: '/prod/selectByName',
    data
  })
}

// 更据名称和编号查找装备信息
export function uploadProdImg(data) {
  return service.request({
    method: 'post',
    url: '/prod/cardupload.do',
    data
  })
}
